<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>登录 - Creeps Judge</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }
            
            body {
                font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
                background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
                margin: 0;
                padding: 0;
                min-height: 100vh;
                display: flex;
                align-items: center;
                justify-content: center;
                overflow: hidden;
            }
            
            body::before {
                content: '';
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: 
                    radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(100, 150, 255, 0.1) 0%, transparent 50%),
                    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
                pointer-events: none;
                z-index: -1;
            }
            
            .login-container {
                background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(30, 30, 60, 0.9) 100%);
                -webkit-backdrop-filter: blur(15px);
                backdrop-filter: blur(15px);
                padding: 3rem;
                border-radius: 20px;
                box-shadow: 
                    0 8px 32px rgba(0, 0, 0, 0.3),
                    0 0 20px rgba(100, 150, 255, 0.2),
                    inset 0 0 15px rgba(255, 255, 255, 0.05);
                width: 100%;
                max-width: 450px;
                border: 2px solid;
                border-image: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(100, 150, 255, 0.6)) 1;
                position: relative;
                overflow: hidden;
            }
            
            .login-container::before {
                content: '';
                position: absolute;
                top: 0;
                left: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
                transition: left 0.5s ease;
            }
            
            .login-container:hover::before {
                left: 100%;
            }
            
            .login-header {
                text-align: center;
                margin-bottom: 2.5rem;
            }
            
            .login-header h1 {
                font-size: 2.5rem;
                background: linear-gradient(135deg, #00d4ff, #6496ff, #ffffff);
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;
                margin-bottom: 1rem;
                text-shadow: 
                    0 0 5px rgba(0, 212, 255, 0.4),
                    0 0 10px rgba(0, 212, 255, 0.3),
                    0 0 15px rgba(0, 212, 255, 0.2);
                filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.3));
            }
            
            .login-header p {
                color: rgba(255, 255, 255, 0.8);
                font-size: 1.1rem;
                margin: 0;
            }
            .form-group {
                margin-bottom: 1.5rem;
            }
            
            .form-group label {
                display: block;
                margin-bottom: 0.75rem;
                color: rgba(255, 255, 255, 0.9);
                font-weight: 500;
                font-size: 1rem;
            }
            
            .form-group input {
                width: 100%;
                padding: 1rem;
                background: rgba(255, 255, 255, 0.1);
                border: 2px solid rgba(255, 255, 255, 0.2);
                border-radius: 12px;
                font-size: 1rem;
                color: white;
                transition: all 0.3s ease;
                box-sizing: border-box;
                backdrop-filter: blur(10px);
            }
            
            .form-group input::placeholder {
                color: rgba(255, 255, 255, 0.5);
            }
            
            .form-group input:focus {
                outline: none;
                border-color: rgba(100, 150, 255, 0.8);
                background: rgba(255, 255, 255, 0.15);
                box-shadow: 
                    0 0 15px rgba(100, 150, 255, 0.3),
                    inset 0 0 10px rgba(255, 255, 255, 0.1);
                transform: translateY(-2px);
            }
            .btn {
                width: 100%;
                padding: 1rem;
                background: linear-gradient(135deg, rgba(100, 150, 255, 0.8), rgba(0, 212, 255, 0.8));
                color: white;
                border: 2px solid rgba(255, 255, 255, 0.3);
                border-radius: 12px;
                font-size: 1.1rem;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
                position: relative;
                overflow: hidden;
                backdrop-filter: blur(10px);
                text-transform: uppercase;
                letter-spacing: 1px;
            }
            
            .btn::before {
                content: '';
                position: absolute;
                top: 0;
                left: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
                transition: left 0.5s ease;
            }
            
            .btn:hover {
                background: linear-gradient(135deg, rgba(100, 150, 255, 1), rgba(0, 212, 255, 1));
                border-color: rgba(255, 255, 255, 0.8);
                transform: perspective(500px) rotateX(5deg) rotateY(5deg) translateZ(10px) translateY(-3px);
                box-shadow: 
                    0 10px 25px rgba(0, 0, 0, 0.3),
                    0 0 30px rgba(100, 150, 255, 0.4),
                    0 0 15px rgba(255, 255, 255, 0.2);
            }
            
            .btn:hover::before {
                left: 100%;
            }
            
            .btn:active {
                transform: perspective(500px) rotateX(2deg) rotateY(2deg) translateZ(5px) translateY(-1px);
            }
            .links {
                text-align: center;
                margin-top: 2rem;
            }
            
            .links p {
                color: rgba(255, 255, 255, 0.7);
                margin: 0;
            }
            
            .links a {
                color: #6496ff;
                text-decoration: none;
                font-weight: 500;
                transition: all 0.3s ease;
                position: relative;
            }
            
            .links a::after {
                content: '';
                position: absolute;
                bottom: -2px;
                left: 0;
                width: 0;
                height: 2px;
                background: linear-gradient(135deg, #6496ff, #00d4ff);
                transition: width 0.3s ease;
            }
            
            .links a:hover {
                color: #00d4ff;
                text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
            }
            
            .links a:hover::after {
                width: 100%;
            }
            .messages {
                margin-bottom: 1.5rem;
            }
            
            .alert {
                padding: 1rem;
                border-radius: 12px;
                margin-bottom: 1rem;
                backdrop-filter: blur(10px);
                border: 1px solid;
                position: relative;
                overflow: hidden;
            }
            
            .alert::before {
                content: '';
                position: absolute;
                top: 0;
                left: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
                transition: left 0.5s ease;
            }
            
            .alert:hover::before {
                left: 100%;
            }
            
            .alert-error {
                background: rgba(220, 53, 69, 0.2);
                color: #ff6b7a;
                border-color: rgba(220, 53, 69, 0.4);
                box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
            }
            
            .alert-success {
                background: rgba(40, 167, 69, 0.2);
                color: #6bcf7f;
                border-color: rgba(40, 167, 69, 0.4);
                box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
            }
            
            /* 响应式设计 */
            @media (max-width: 768px) {
                .login-container {
                    margin: 1rem;
                    padding: 2rem;
                    max-width: none;
                }
                
                .login-header h1 {
                    font-size: 2rem;
                }
                
                body {
                    overflow: auto;
                }
            }
        </style>
    </head>
    <body>
        <div class="login-container">
            <div class="login-header">
                <h1>登录</h1>
                <p>欢迎回到 Creeps Judge</p>
            </div>

            {% if messages %}
            <div class="messages">
                {% for message in messages %}
                <div class="alert alert-{{ message.tags }}">{{ message }}</div>
                {% endfor %}
            </div>
            {% endif %} {% if form.errors %}
            <div class="alert alert-error">
                {% for field, errors in form.errors.items %} {% for error in errors %}
                <p>{{ error }}</p>
                {% endfor %} {% endfor %}
            </div>
            {% endif %}

            <form method="post">
                {% csrf_token %}
                <div class="form-group">
                    <label for="{{ form.username.id_for_label }}">用户名:</label>
                    {{ form.username }}
                </div>
                <div class="form-group">
                    <label for="{{ form.password.id_for_label }}">密码:</label>
                    {{ form.password }}
                </div>
                <button type="submit" class="btn">登录</button>
            </form>

            <div class="links">
                <p>还没有账户？ <a href="{% url 'accounts:signup' %}">立即注册</a></p>
            </div>
        </div>
    </body>
</html>
